Skip to content

[claude] Consume hai-agents SDK local mode; drop owned binary lifecycle#3

Draft
cm2435-hcomp wants to merge 9 commits into
mainfrom
claude/holo-sdk-local-mode
Draft

[claude] Consume hai-agents SDK local mode; drop owned binary lifecycle#3
cm2435-hcomp wants to merge 9 commits into
mainfrom
claude/holo-sdk-local-mode

Conversation

@cm2435-hcomp

Copy link
Copy Markdown
Collaborator

What

HoloDesktop stops owning the runtime binary lifecycle and consumes hai-agents[local] instead (plan 003 of eng_plans/30-06-2026-agent-api-local-runtime). Net −1,353 LoC (1,500 added, 2,853 deleted).

  • Deletes the owned installer/launcher (download/cache/spawn/token/pid/health/kill) and their tests — after porting the behaviors those tests pinned to the SDK contract first.
  • Adds a thin spawn-env bridge (sdk_runtime.py, inherit_env=False, keeps the self-hosted HAI_API_KEY strip), a SessionApi adapter over AsyncClient.local/AsyncSessionHandle, and re-homes macOS TCC first-run detection to read the SDK's runtime.log_path (permissions.py).
  • holo stop --force uses SDK cross-process discovery + a one-release legacy ~/.holo/agent-pid-<port> read; holo doctor/agent-api report SDK runtime state.

Why

One shared, tested binary lifecycle in the SDK instead of a HoloDesktop-private copy. HoloDesktop keeps everything product-shaped.

How — what stays byte-identical (verified 0-line diff vs baseline)

requests.py (Holo request/profile construction), session_runner.py, and the entire killswitch/ package (~/.holo/stop double-Esc → pause-then-cancel) are unchanged — only the HTTP calls behind them moved to SDK handles. The session-runner swap was gated by a fake-mode integration test before and after.

Validation

  • 361 passed, 12 skipped (skips are opt-in/env-gated); mypy clean (47 files)
  • Fake-mode integration gate passed against the real 0.1.8 binary post-swap

⛔ SHIP-GATE

pyproject.toml pins hai-agents via a dev [tool.uv.sources] path override to the local SDK mirror (marked # SHIP-GATE). Replace with the published hai-agents[local] version — plan 002 must publish first.

Owner live-smoke checklist (your terminal — TCC/desktop, not an agent context)

  1. uv run holo doctor — all green, agent-api reports SDK runtime state
  2. uv run holo run --fake --no-kill-switch "say hi" — exit 0
  3. uv run holo run "open calculator" — opens + answer panel; retry with double-Esc → ✗ interrupted
  4. holo serve + holo stop --force (two terminals) → force-killed runtime pid(s) …
  5. Fresh-macOS TCC walkthrough (delete ~/.holo/.first-run-complete, run, confirm panel + one auto-restart + marker)

Notes

Known-stale (deliberate, left for follow-up to preserve the "no killswitch diff" rule): killswitch/__init__.py docstring still names the old launcher path. Stack: depends on plan 002 being published; landing order per the master README.

🤖 Generated with Claude Code

cm2435-hcomp and others added 9 commits July 4, 2026 17:33
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant